package com.wind.taobao.api.trade.trade.rest
{
	import com.wind.taobao.api.IPrivateAPI;
	import com.wind.taobao.core.exception.InvalidRequestParametersException;
	import com.wind.taobao.core.util.TaobaoUtils;
	import com.wind.taobao.core.webservice.TaobaoRequest;

	/**
	 * taobao.trade.close Request
	 * @author fxy
	 *
	 */
	public class TradeCloseRequest extends TaobaoRequest implements IPrivateAPI
	{
		public override function get method():String
		{
			return "taobao.trade.close"
		}
		/**
		 * Y 	 交易ID
		 */
		[Bindable]
		public var tid:String;
		/**
		 * Y 	交易关闭原因。最小长度: 6个字节
		 */
		[Bindable]
		public var close_reason:String;

		public override function validate():void
		{
			if (!TaobaoUtils.hasAllValue([tid, close_reason]))
			{
				throw new InvalidRequestParametersException("请求参数[tid, close_reason]不能为空");
			}
			if (close_reason.length < 6)
			{
				throw new InvalidRequestParametersException("请求参数[close_reason]长度不能小于6");
			}
		}

	}
}